libname motind5 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data';

libname ind5 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\independents5';
libname dem5 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\democrats5';
libname rep5 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\republicans5';

data motind5.long; set ind5.all dem5.all rep5.all; run;

proc freq data=motind5.long; table partyid forcedparty; run;
proc freq data=dem5.all; table partyid forcedparty; run;
proc freq data=ind5.all; table partyid forcedparty; run;
proc freq data=rep5.all; table partyid forcedparty; run;


**********************************CLEANING AND RECODING DATA**************************************;

data working; set motind5.long; run;

proc freq data=working; table answeromc;
proc means data=working; var rt1omc; run;

data working; set working; 
IMC = 0; 
if rt1omc = . then IMC = .; 
else if rt1omc = 0 then IMC = 1; run;

proc freq; table IMC; run;

data working; set working;
format birth MMDDYYN.;
if BMonth = 2 then birth = MDY(bmonth,28,byear); 
  else if BMonth IN (1, 3, 5, 7, 8, 10, 12)	then birth = MDY(bmonth,31,byear); 
  else if BMonth IN (4, 6, 9, 11) then birth = MDY(bmonth,30,byear); 
  else if BMonth = . AND BYear NE . then birth = MDY(12,31,byear); run;

data working; set working;
format age 2.0;
age=FLOOR((INTCK('month',birth,DATEPART(session_date))) / 12);
drop birth;RUN;

proc means data=working; var age; run;
proc contents data=working; run;

*basic IAT cleaning - set to missing IAT scores that algorithm marked for data that was excluded or incomplete;
proc freq data=working; tables plan_R_exclude party_R_exclude; run;

data working; set working;
if  plan_R_exclude ne 0 then planiat = .; 
if  party_R_exclude ne 0 then politicsiat = .; run; 

*identify people with too many total errors on the IAT and set IAT data to missing;
data working; set working;
plan_TotalError = mean(plan_EB3, plan_EB4, plan_EB6, plan_EB7); 
party_TotalError = mean(party_EB3, party_EB4, party_EB6, party_EB7); run;

proc freq data=working; tables plan_TotalError party_TotalError; run;

data working; set working;
if plan_TotalError > .30 then planiat = .; 
if party_TotalError > .30 then politicsiat = .; run;

*identify people with too many errors in each block on the IAT and set IAT data to missing;
data working; set working;
if plan_EB3 > .40 then planiat = .;
else if plan_EB4 > .40 then planiat = .;
else if plan_EB6 > .40 then planiat = .;
else if plan_EB7 > .40 then planiat = .; run;

data working; set working;
if party_EB3 > .40 then politicsiat = .;
else if party_EB4 > .40 then politicsiat = .;
else if party_EB6 > .40 then politicsiat = .;
else if party_EB7 > .40 then politicsiat = .; run;

*coding edu as continuous;
data working; set working;
format education 1.;
if edu = 1 then education = 1; *elementary school;
else if edu = 2 then education = 2; *junior high;
else if edu = 3 then education = 3; *some high school;
else if edu = 4 then education = 4; *high school graduate;
else if edu in (5,6) then education = 5; *some college and associate's degree;
else if edu = 7 then education = 6; *bachelor's degree;
else if edu in (8,9,14) then education = 7; *some graduate school, master's degree, MBA;
else if edu in (10,11,13) then education = 8; *JD, MD, other advanced degree;
else if edu = 12 then education = 9; run; *PhD;

*getting rid of non-US citizens - asked for this, but didn't get it;
data working; set working; 
if citizen NE "us" then delete; run;
*48 subjects deleted;

TITLE 'Completers vs Noncompleters';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Completers vs Noncompleters.html';

*how are consenters different from completers of the DV?;
data working; set working;
if consented = . then delete; *159 subjects deleted; **same;
if debriefed = . then debriefed = 0; run;
proc ttest data=working; class debriefed; var age edu; run;
proc freq data=working; 
tables gender*debriefed  / chisq ; run;

ODS HTML CLOSE;

*getting rid of people who did not complete the 2 main DVs;
data working; set working;
if planiat = . then delete; 
if planprefer = . then delete; run;
*576 subjects deleted;

*recoding variables;
data working; set working;
socialpolitics = .;
if socpolitics = 1 then socialpolitics = 3; 
else if socpolitics = 2 then socialpolitics = 2; 
else if socpolitics = 3 then socialpolitics = 1; 
else if socpolitics = 4 then socialpolitics = 0; 
else if socpolitics = 5 then socialpolitics = -1; 
else if socpolitics = 6 then socialpolitics = -2; 
else if socpolitics = 7 then socialpolitics = -3; run;

data working; set working;
economicpolitics = .;
if econpolitics = 1 then economicpolitics = 3; 
else if econpolitics = 2 then economicpolitics = 2; 
else if econpolitics = 3 then economicpolitics = 1; 
else if econpolitics = 4 then economicpolitics = 0; 
else if econpolitics = 5 then economicpolitics = -1; 
else if econpolitics = 6 then economicpolitics = -2; 
else if econpolitics = 7 then economicpolitics = -3; run;

data working; set working;
partyforce = .;
if forcedparty = 1 then partyforce = -3; 
else if forcedparty = 2 then partyforce = -2; 
else if forcedparty = 3 then partyforce = -1; 
else if forcedparty = 4 then partyforce = 0; 
else if forcedparty = 5 then partyforce = 1; 
else if forcedparty = 6 then partyforce = 2; 
else if forcedparty = 7 then partyforce = 3; run;

data working; set working;
informat majorparty $9.;
majorparty = "."; 
if partyid = 1 then majorparty = "Dem"; 
else if partyid = 2 then majorparty = "Rep"; 
else if partyid = 3 then majorparty = "Ind"; run;

data working; set working;
informat indforce $9.;
indforce = "."; 
if partyforce in (1,2,3) then indforce = "DemInd"; 
else if partyforce = 0 then indforce = "StrongInd"; 
else if partyforce in (-1,-2,-3) then indforce = "RepInd"; run;

data working; set working;
detailsinfluenced = howdetails; run;

data working; set working;
prefermain = .;
if planprefer = 1 then prefermain = 3; 
else if planprefer = 2 then prefermain = 2; 
else if planprefer = 3 then prefermain = 1; 
else if planprefer = 4 then prefermain = 0; 
else if planprefer = 5 then prefermain = -1; 
else if planprefer = 6 then prefermain = -2; 
else if planprefer = 7 then prefermain = -3; run;

proc means data=working; var prefermain planprefer; run;
proc corr data=working; var prefermain planprefer; run;

data working; set working;
poliat = 0 - politicsiat; run;

data working; set working; 
informat poliatbin $19.;
poliatbin = "."; 
if poliat > .15 then poliatbin = "Implicit Democrat";
else if poliat < -.15 then poliatbin = "Implicit Republican"; run;

data working; set working;
conditionnum = .; 
if condition = "dem" then conditionnum = .5; 
else if condition = "rep" then conditionnum = -.5; run;

data working; set working;
if partyinfluenced = 1 then aware = -.5; 
else if partyinfluenced in (2,3,4,5) then aware = .5; run;

data working; set working; 
taskordernum = .; 
if taskorder = "party1st" then taskordernum = .5; 
else if taskorder = "plan1st" then taskordernum = -.5; run;

proc contents data=working; run;
proc means data=working; run;

proc freq data=working; tables condition conditionnum taskorder taskordernum; run;

data motind5.all; set working; 
keep session_id session_status consented creation_date debriefed

aware condition conditionnum dvorder ivorder major taskorder taskordernum

age citizen education ethniccen gender genoccupation racecen relID reldenom relfamily religion resdnce

detailsinfluenced partyinfluenced socialinfluenced

manip1 manip2 IMC 

economicpolitics indforce majorparty partyforce partyid politics socialpolitics

planiat prefermain poliat poliatbin; run;


************************************************************************
CLEAN DATASET INCLUDES 1865 who:
only us citizens 
only people who completed both 2 DVs 

RETAINED PEOPLE who:
failed the IMC
************************************************************************;

**********************************Sample Characteristics**************************************;

TITLE 'Combined Sample Characteristics';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Combined Sample Characteristics.html';

proc freq data=motind5.all;
tables gender racecen ethniccen citizen partyid; run;

proc univariate data=motind5.all; var education education; run;
proc freq data=motind5.all; table education education; run;

proc means data=motind5.all; 
var relID socialpolitics economicpolitics poliat age; run;

proc sort data=motind5.all; by majorparty;

proc freq data=motind5.all; by majorparty; 
tables gender racecen ethniccen citizen partyid education; run;

proc means data=motind5.all; by majorparty;
var relID socialpolitics economicpolitics poliat age; run;
*biasinfluence - higher is more agreement with decisions can be biased 1 to 7;

proc freq data=motind5.all; by majorparty; 
table partyforce indforce; run;

ODS HTML CLOSE;


*************************making new datasets to analyze data easily*********************;
data motind5.ind; set motind5.all; 
keep = 0; 
if majorparty = "Ind" then keep = 1; 
if keep = 0 then delete; run;

data motind5.strong; set motind5.ind; 
keep = 0; 
if partyforce = 0 then keep = 1; 
if keep = 0 then delete; run;

data motind5.rep; set motind5.all; 
keep = 0; 
if majorparty = "Rep" then keep = 1; 
if keep = 0 then delete; run;

data motind5.dem; set motind5.all; 
keep = 0; 
if majorparty = "Dem" then keep = 1; 
if keep = 0 then delete; run;


*************manipulation checks****************;

TITLE 'Manip Checks';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Manip Checks.html';

proc freq data=motind5.all; tables IMC; run;

proc sort data=motind5.all; by condition;
proc freq data=motind5.all; by condition;
tables manip1 manip2; run; 

proc sort data=motind5.all; by IMC condition;
proc freq data=motind5.all; by IMC condition;
tables manip1 manip2; run;

ODS HTML CLOSE;

TITLE 'Main Analysis with Study Manip Check Failures Removed';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Main Analysis with Study Manip Check Failures Removed.html';

data motind5.manip; set motind5.all; run;

data motind5.manip; set motind5.manip; 
if condition = "rep" AND manip1 = 2 then delete; run;  *87;

data motind5.manip; set motind5.manip; 
if condition = "dem" AND manip1 = 1 then delete; run; *69;

data motind5.manip; set motind5.manip; 
if manip2 = 1 then delete; run; *25;

proc sort data=motind5.manip; by majorparty; 

proc ttest data=motind5.manip; by majorparty; 
class condition; var prefermain planiat; run;

proc glm data=motind5.manip (where=(majorparty="Ind")); 
class condition;
model prefermain=condition|poliat; run;

proc glm data=motind5.manip (where=(majorparty="Ind")); 
class condition;
model planiat=condition|poliat; run;

proc glm data=motind5.manip (where=(indforce="StrongInd")); 
class condition;
model prefermain=condition|poliat; run;

proc glm data=motind5.manip (where=(indforce="StrongInd")); 
class condition;
model planiat=condition|poliat; run;

ODS HTML CLOSE;

**************************************DESCRIPTIVES*********************************************;

TITLE 'Combined Sample Analysis';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Combined Analysis.html';

proc means data=motind5.all ; 
var prefermain planiat; run;

proc corr data=motind5.all; var planiat prefermain; run;

proc means data=motind5.all ; class majorparty;
var prefermain planiat; run;

proc sort data=motind5.all; by majorparty; 
proc corr data=motind5.all;  by majorparty; var planiat prefermain; run;

proc means data=motind5.all ; class majorparty;
var partyinfluenced socialinfluenced detailsinfluenced; run;
*higher is more influence 1 to 5;

proc means data=motind5.all; 
var partyinfluenced socialinfluenced detailsinfluenced; run;
*higher is more influence 1 to 5;

*looking at condition/party interactions;
proc sort data=motind5.all; by majorparty; 
proc freq data=motind5.all ; by majorparty;
tables partyinfluenced detailsinfluenced; run;
proc means data=motind5.all ; class majorparty;
var prefermain planiat; run;

proc means data=motind5.all ; by majorparty; class condition; 
var planiat prefermain; run;

*ideal combined graph would have dems, reps, ind, and then implicit rep and dem ind, so 5 bars;
proc means data=motind5.all; by majorparty; class poliatbin condition; 
var planiat prefermain; run;

*testing hypotheses on reasoning;
proc glm data=motind5.all ; class majorparty; 
model partyinfluenced=majorparty; means majorparty / tukey; run;

ODS HTML CLOSE;



/*************************************************************************************************************************************
**********************************************************Analyses********************************************************************
*************************************************************************************************************************************/


TITLE 'Rep-Dem Average Difference';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Rep-Dem Average Difference.html';
data motind5.two; set motind5.all; 
keep = 0; 
if majorparty in ("Dem", "Rep") then keep=1; 
if keep = 0 then delete; run;

proc ttest data=motind5.two; class majorparty; var prefermain planiat; run;
ODS HTML CLOSE; 


**********************************DEMOCRATS**************************************;

TITLE 'Democrats Analysis';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Democrats Analysis.html';

*test of hypothesis;
proc ttest data=motind5.dem; 
class condition; var prefermain planiat; run;

*covarying DV order;
proc glm data=motind5.dem ; class condition dvorder;
model prefermain=condition|dvorder; run;

proc glm data=motind5.dem; class condition dvorder;
model planiat=condition|dvorder; run;

*covarying study order;
TITLE1 'Does order of the tasks matter?';
proc glm data=motind5.dem; 
model planiat=conditionnum|taskordernum; run;

proc glm data=motind5.dem; 
model prefermain=conditionnum|taskordernum; run;

proc sort data=motind5.dem ; by condition; 
proc corr data=motind5.dem ; by condition; 
var planiat prefermain detailsinfluenced partyinfluenced; run;

ODS HTML CLOSE;


**********************************REPUBLICANS**************************************;

TITLE 'Republicans Analysis';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Republicans Analysis.html';

*test of hypothesis;
proc ttest data=motind5.rep ; 
class condition; var prefermain planiat; run;

*covarying DV order;
proc glm data=motind5.rep; class condition dvorder;
model prefermain=condition|dvorder; run;

proc glm data=motind5.rep ; class condition dvorder;
model planiat=condition|dvorder; run;

*covarying study order;
TITLE1 'Does order of the tasks matter?';
proc glm data=motind5.rep; 
model planiat=conditionnum|taskordernum; run;

proc glm data=motind5.rep; 
model prefermain=conditionnum|taskordernum; run;

proc sort data=motind5.rep ; by condition; 
proc corr data=motind5.rep ; by condition; 
var planiat prefermain detailsinfluenced partyinfluenced; run;

ODS HTML CLOSE;


**********************************INDEPENDENTS**************************************;

TITLE 'CIs on main analyses';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\CIs on main analyses.html';

proc glm data=motind5.ind; 
model prefermain=conditionnum|poliat / CLPARM; run;

proc glm data=motind5.ind; 
model planiat=conditionnum|poliat / CLPARM; run;

proc glm data=motind5.strong;
model prefermain=conditionnum|poliat / CLPARM; run;

proc glm data=motind5.strong;
model planiat=conditionnum|poliat / CLPARM; run;

ODS HTML CLOSE; 


TITLE 'Task Order for Independents';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\results\Task Order for Independents.html';

proc glm data=motind5.ind; 
model prefermain=conditionnum|poliat|taskordernum / CLPARM; run;

proc glm data=motind5.ind; 
model planiat=conditionnum|poliat|taskordernum / CLPARM; run;

TITLE 'Pure Independents';
proc glm data=motind5.strong;
model prefermain=conditionnum|poliat|taskordernum / CLPARM; run;

proc glm data=motind5.strong;
model planiat=conditionnum|poliat|taskordernum / CLPARM; run;

TITLE 'Pure Independents Follow-up';
proc sort data=motind5.strong; by taskordernum; 

proc glm data=motind5.strong; by taskordernum; 
model prefermain=conditionnum|poliat / CLPARM; run;

proc glm data=motind5.strong; by taskordernum; 
model planiat=conditionnum|poliat / CLPARM; run;

ODS HTML CLOSE; 


TITLE 'Independents - IAT incremental validity WITH CIs';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\Independents - IAT incremental validity WITH CIs.html';

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce poliat / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce poliat
partyinfluenced*conditionnum partyforce*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce poliat
partyinfluenced*conditionnum partyforce*conditionnum poliat*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce poliat / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce poliat
partyinfluenced*conditionnum partyforce*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce poliat
partyinfluenced*conditionnum partyforce*conditionnum poliat*conditionnum / CLPARM ; run;

ODS HTML CLOSE;



TITLE 'Independents - IAT incremental validity WITH CIs WITH political ideology';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\Independents - IAT incremental validity WITH CIs WITH political ideology.html';

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce politics / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce politics poliat / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce politics poliat
partyinfluenced*conditionnum partyforce*conditionnum politics*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model prefermain=conditionnum partyinfluenced partyforce politics poliat
partyinfluenced*conditionnum partyforce*conditionnum politics*conditionnum poliat*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce politics / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce politics poliat / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce politics poliat
partyinfluenced*conditionnum partyforce*conditionnum politics*conditionnum / CLPARM ; run;

proc glm data=motind5.ind; 
model planiat=conditionnum partyinfluenced partyforce politics poliat
partyinfluenced*conditionnum partyforce*conditionnum politics*conditionnum poliat*conditionnum / CLPARM ; run;

ODS HTML CLOSE;


**********************************FOLLOW-UP ANALYSES**************************************;

TITLE 'Full Sample - IAT incremental validity WITH CIs';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\Full Sample - IAT incremental validity WITH CIs.html';

data motind5.major; set motind5.all; 
keep = 0; 
if majorparty in ("Dem", "Rep", "Ind") then keep=1; 
if keep = 0 then delete; run;

data motind5.major; set motind5.major; 
informat newparty 1.; 
newparty = .; 
if majorparty = "Rep" then newparty = -2; 

if majorparty = "Ind" then do; 
if indforce = "RepInd" then newparty = -1; 
else if indforce = "StrongInd" then newparty = 0; 
else if indforce = "DemInd" then newparty = 1; end; 

else if majorparty = "Dem" then newparty = 2; run;

proc glm data=motind5.major; 
model prefermain=conditionnum partyinfluenced newparty / CLPARM; run;

proc glm data=motind5.major; 
model prefermain=conditionnum partyinfluenced newparty poliat / CLPARM; run;

proc glm data=motind5.major; 
model prefermain=conditionnum partyinfluenced newparty poliat
partyinfluenced*conditionnum newparty*conditionnum / CLPARM; run;

proc glm data=motind5.major; 
model prefermain=conditionnum partyinfluenced newparty poliat
partyinfluenced*conditionnum newparty*conditionnum poliat*conditionnum / CLPARM; run;

proc glm data=motind5.major; 
model planiat=conditionnum partyinfluenced newparty / CLPARM; run;

proc glm data=motind5.major; 
model planiat=conditionnum partyinfluenced newparty poliat / CLPARM; run;

proc glm data=motind5.major; 
model planiat=conditionnum partyinfluenced newparty poliat
partyinfluenced*conditionnum newparty*conditionnum / CLPARM; run;

proc glm data=motind5.major; 
model planiat=conditionnum partyinfluenced newparty poliat
partyinfluenced*conditionnum newparty*conditionnum poliat*conditionnum / CLPARM; run;

ODS HTML CLOSE; 



TITLE1 'Awareness';
ODS HTML BODY = 'C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\Awareness.html';

proc sort data=motind5.all; by majorparty; 
proc means data=motind5.all n mean std; by majorparty; class condition aware; var prefermain planiat; run;

Title1 'Independents - Continuous Awareness';
proc glm data=motind5.ind; 
model prefermain=conditionnum|poliat|partyinfluenced / CLPARM; run;

proc glm data=motind5.ind; 
model planiat=conditionnum|poliat|partyinfluenced / CLPARM; run;

Title1 'Independents - Dichotomous Awareness';
proc glm data=motind5.ind; 
model prefermain=conditionnum|poliat|aware / CLPARM; run;

proc glm data=motind5.ind; 
model planiat=conditionnum|poliat|aware / CLPARM; run;

Title1 'Independents - Dichotomous Awareness 3-way removed';
proc glm data=motind5.ind; 
model prefermain=conditionnum poliat aware
conditionnum*poliat conditionnum*aware/ CLPARM; run;

proc glm data=motind5.ind; 
model planiat=conditionnum poliat aware
conditionnum*poliat conditionnum*aware/ CLPARM; run;

TITLE1 'Democrats - Dichotomous Awareness';
proc glm data=motind5.dem; 
model prefermain=conditionnum|aware / CLPARM; run;

proc glm data=motind5.dem; 
model planiat=conditionnum|aware / CLPARM; run;

TITLE1 'Republicans - Dichotomous Awareness';
proc glm data=motind5.rep; 
model prefermain=conditionnum|aware / CLPARM; run;

proc glm data=motind5.rep; 
model planiat=conditionnum|aware / CLPARM; run;

ODS HTML CLOSE; 



**********************************GRAPHING**************************************;

*reverse coding implicit party identity for graphing only - now ID with democrats is negative so that it is on the left for graphing purposes;
data motind5.ind; set motind5.ind; 
poliat_reverse = 0-poliat; run;
proc corr data=motind5.ind; var poliat poliat_reverse; run;
proc means data=motind5.ind; var poliat poliat_reverse; run;

ods listing close;
goptions reset=all device=pdf hsize=4.6in vsize=3in gsfmode=replace gsfname=grafout HORIGIN=1 vorigin=7 ftext=ariel ;
ods pdf file='C:\Users\Carlee\Documents\Research Projects\Moderates\motivatedindependents5\data\study 5 graphs.pdf' startpage=never;

AXIS1 LABEL=(ANGLE=90 ROTATE=0 h=9pt "Explicit Preference for Generous Plan") MINOR=(n=1) order=-4 to 4 by 2 value=(h=8pt);
AXIS2 LABEL=(h=9pt "Implicitly Democratic        Implicitly Republican") minor=none order=-.8 to 1.0 by .4 value=(h=8pt);
legend1 label=none shape=line(20pt) mode=share position=(top right inside) across=1 
value=( h=9pt j=l "Democrats Proposed Generous Plan" "Republicans Proposed Generous Plan");
SYMBOL1 INTERPOL=R C=black line=1 mode=include w=3;
SYMBOL2 INTERPOL=R C=black line=2 mode=include w=3; 
PROC GPLOT DATA=motind5.ind ; 
	PLOT	prefermain*poliat_reverse=condition / vaxis=axis1 haxis=axis2 legend=legend1 noframe ; RUN;quit;

goptions reset=all device=pdf hsize=4.6in vsize=3in gsfmode=replace gsfname=grafout HORIGIN=1 vorigin=4.25 ftext=ariel;
AXIS1 LABEL=(ANGLE=90 ROTATE=0 h=9pt "Implicit Preference for Generous Plan") MINOR=(n=1) order=-.7 to 1.1 by .35 value=(h=8pt);
AXIS2 LABEL=(h=9pt "Implicitly Democratic        Implicitly Republican") minor=none order=-.8 to 1.0 by .4 value=(h=8pt);
SYMBOL1 INTERPOL=R C=black line=1 mode=include w=3;
SYMBOL2 INTERPOL=R C=black line=2 mode=include w=3; 
PROC GPLOT DATA=motind5.ind ; 
	PLOT	planiat*poliat_reverse=condition / vaxis=axis1 haxis=axis2 nolegend noframe ; RUN;quit;

ods pdf close;
ods listing;
   

*removing selected demographics that could possibly be identifying for posting data;

data motind5.post; set motind5.all; 
drop genoccupation major reldenom  relfamily religion; run;

